using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Finance.Web.Models.Mapping;

namespace Finance.Web.Models
{
    public partial class FinanceContext : DbContext
    {
        static FinanceContext()
        {
            Database.SetInitializer<FinanceContext>(null);
        }

        public FinanceContext()
            : base("Name=FINANCEContext")
        {
        }

        public DbSet<Bank> Banks { get; set; }
        public DbSet<Deposit> Deposites { get; set; }
        public DbSet<User> Users { get; set; }
        public DbSet<UserDeposit> UserDeposites { get; set; }
        public DbSet<PercentAmountDepend> PercentAmountDepends { get; set; }
        public DbSet<PercentPenalty> PercentPenalties { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new BankMap());
            modelBuilder.Configurations.Add(new DepositMap());
            modelBuilder.Configurations.Add(new UserMap());
            modelBuilder.Configurations.Add(new UserDepositMap());
            modelBuilder.Configurations.Add(new PercentAmountDependMap());
            modelBuilder.Configurations.Add(new PercentPenaltyMap());
        }
    }
}
